home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.4)
-
- import unittest
- from test import test_support
- import re
- rx = re.compile('\\((\\S+).py, line (\\d+)')
-
- def get_error_location(msg):
- mo = rx.search(str(msg))
- return mo.group(1, 2)
-
-
- class FutureTest(unittest.TestCase):
-
- def test_future1(self):
- test_support.unload('test_future1')
- test_future1 = test_future1
- import test
- self.assertEqual(test_future1.result, 6)
-
-
- def test_future2(self):
- test_support.unload('test_future2')
- test_future2 = test_future2
- import test
- self.assertEqual(test_future2.result, 6)
-
-
- def test_future3(self):
- test_support.unload('test_future3')
- test_future3 = test_future3
- import test
-
-
- def test_badfuture3(self):
-
- try:
- badsyntax_future3 = badsyntax_future3
- import test
- except SyntaxError:
- msg = None
- self.assertEqual(get_error_location(msg), ('badsyntax_future3', '3'))
-
- self.fail("expected exception didn't occur")
-
-
- def test_badfuture4(self):
-
- try:
- badsyntax_future4 = badsyntax_future4
- import test
- except SyntaxError:
- msg = None
- self.assertEqual(get_error_location(msg), ('badsyntax_future4', '3'))
-
- self.fail("expected exception didn't occur")
-
-
- def test_badfuture5(self):
-
- try:
- badsyntax_future5 = badsyntax_future5
- import test
- except SyntaxError:
- msg = None
- self.assertEqual(get_error_location(msg), ('badsyntax_future5', '4'))
-
- self.fail("expected exception didn't occur")
-
-
- def test_badfuture6(self):
-
- try:
- badsyntax_future6 = badsyntax_future6
- import test
- except SyntaxError:
- msg = None
- self.assertEqual(get_error_location(msg), ('badsyntax_future6', '3'))
-
- self.fail("expected exception didn't occur")
-
-
- def test_badfuture7(self):
-
- try:
- badsyntax_future7 = badsyntax_future7
- import test
- except SyntaxError:
- msg = None
- self.assertEqual(get_error_location(msg), ('badsyntax_future7', '3'))
-
- self.fail("expected exception didn't occur")
-
-
- def test_badfuture8(self):
-
- try:
- badsyntax_future8 = badsyntax_future8
- import test
- except SyntaxError:
- msg = None
- self.assertEqual(get_error_location(msg), ('badsyntax_future8', '3'))
-
- self.fail("expected exception didn't occur")
-
-
- def test_badfuture9(self):
-
- try:
- badsyntax_future9 = badsyntax_future9
- import test
- except SyntaxError:
- msg = None
- self.assertEqual(get_error_location(msg), ('badsyntax_future9', '3'))
-
- self.fail("expected exception didn't occur")
-
-
-
- def test_main():
- test_support.run_unittest(FutureTest)
-
- if __name__ == '__main__':
- test_main()
-
-